<%@ include file="/common/taglibs.jsp"%>

<input type="hidden" id="quickSearchType" name="quickSearchType" value="${quickSearchType}">	
<c:set var="editURLPath"	value="/sales/promoRule.html?doAction=edit&from=list" scope="page" />
<div class="top clearfix">
	<ul class="tab">
		<li class="curr"><span><fmt:message key="menu.promotionList"/></span></li>
	</ul>
	<%@include file="/common/pagingOnlyTop.jsp"%>
</div>		
<div class="data">
	<c:set var="checkAll">
		<input type="checkbox" name="allbox" onclick="checkAll(this.form)"	style="margin: 0 0 0 0px" />
	</c:set>

	<table id="promoRule" width="100%" border="0" cellspacing="0"
		cellpadding="0" class="list_table">
		<tr>
			<th width="20">${checkAll}</th>
			<th style="width: 63%"
				class='sortable ${(promoRuleSearchCriteria.orderby eq 1)?"sorted order1":((promoRuleSearchCriteria.orderby eq 2)?"sorted order2":"")}'>
				<a onclick="sortField(this,1,2)"><fmt:message
						key="promoRule.name" /></a>
			</th>
			<th style="width: 5%"
				class='sortable ${(promoRuleSearchCriteria.orderby eq 3)?"sorted order1":((promoRuleSearchCriteria.orderby eq 4)?"sorted order2":"")}'>
				<a onclick="sortField(this,3,4)"><fmt:message
						key="promoRule.priority" /></a>
			</th>
			<th style="width: 5%"
				class='sortable ${(promoRuleSearchCriteria.orderby eq 5)?"sorted order1":((promoRuleSearchCriteria.orderby eq 6)?"sorted order2":"")}'>
				<a onclick="sortField(this,5,6)"><fmt:message
						key="promoRule.enableDiscountAgain" /></a>
			</th>
			<th style="width: 12%"
				class='sortable ${(promoRuleSearchCriteria.orderby eq 7)?"sorted order1":((promoRuleSearchCriteria.orderby eq 8)?"sorted order2":"")}'>
				<a onclick="sortField(this,7,8)"><fmt:message
						key="promoRule.promoType" /></a>
			</th>
			<th style="width: 12%"
				class='sortable ${(promoRuleSearchCriteria.orderby eq 23)?"sorted order1":((promoRuleSearchCriteria.orderby eq 24)?"sorted order2":"")}'>
				<span><fmt:message
						key="promoRule.status" /></span>
			</th>
		</tr>
		<c:forEach var="promoRuleItem" items="${promoRuleList}" varStatus="status">
			<tr  class="${(status.index%2==0)?'even':'odd'}">
				<td>
					<input type="checkbox" name="multiIds"	value="${promoRuleItem.promoRuleId}" class="checkbox"	title="${promoRuleItem.name}" />
				</td>
				<td><a href="${ctxPath}${editURLPath}&promoRuleId=${promoRuleItem.promoRuleId}">${promoRuleItem.name}</td>
				<td>${promoRuleItem.priority}</td>
				<td>
					<c:if test="${promoRuleItem.enableDiscountAgain == '1'}">
						<c:set var="enableDiscountAgainImgSrc" value="check.gif"></c:set>
					</c:if>
					<c:if test="${promoRuleItem.enableDiscountAgain == '0'}">
						<c:set var="enableDiscountAgainImgSrc" value="uncheck.gif"></c:set>
					</c:if>
					<img src="../images/icon/${enableDiscountAgainImgSrc}"/>&nbsp;
				</td>
				<td>
					<c:if test="${promoRuleItem.promoType == 'catalogPromotion'}">
						<c:set var="promoTypeImgSrc" value="ico_catalog.gif"></c:set>
					</c:if>
					<c:if test="${promoRuleItem.promoType == 'shoppingcartPromotion'}">
						<c:set var="promoTypeImgSrc" value="ico_shoppingcart.gif"></c:set>
					</c:if>
					<c:if test="${promoRuleItem.promoType == 'couponPromotion'}">
						<c:set var="promoTypeImgSrc" value="ico_coupon.gif"></c:set>
					</c:if>
					
					<img src="../images/icon/${promoTypeImgSrc}"/>	<fmt:message key="promoRule.promoType.${promoRuleItem.promoType}" />
				</td>
				<td>
					<c:if test="${promoRuleItem.state == 1}">
						<c:set var="stateClass" value="txt-process"></c:set>
					</c:if>
					<c:if test="${promoRuleItem.state == 2}">
						<c:set var="stateClass" value="txt-future"></c:set>
					</c:if>
					<c:if test="${promoRuleItem.state == 3}">
						<c:set var="stateClass" value="txt-preterite"></c:set>
					</c:if>
					<c:if test="${promoRuleItem.state == 0}">
						<c:set var="stateClass" value="txt-disabled"></c:set>
					</c:if>
					<span class="${stateClass}"><fmt:message key="promoRule.state.s${promoRuleItem.state}" /></span>
				</td>
			</tr>
		</c:forEach>
		<c:if test="${empty promoRuleList}">
			<tr>
				<td colspan="6" style="text-align: center"><fmt:message
						key="promoRuleList.empty" /></td>
			</tr>
		</c:if>
	</table>
	<%@include file="/common/pagingOnly.jsp"%>
</div>

<%--------保存查询条件 -------%>
<%@include file="promoRuleSearchCriteriaStorage.jspf"%>

<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("promoRuleItem");
});
</script>







